package com.util.validate;

import com.util.aliyun.OCSutils;

/**
 * Created by reeveslee on 16/6/21.
 */
public class UserValidate {
    private static OCSutils ocSutils = new OCSutils();

    public static int validate(int userId, String kbToken) {
        if (ocSutils.get("kbToken" + userId) == null) {
            // 没有相关token信息
            return 0;
        } else if (!kbToken.equals(ocSutils.get("kbToken" + userId))) {
            // token错误
            return 2;
        } else {
            // token正确
            return 1;
        }
    }
}
